package hhf.common.acid.operation {
	import mx.core.mx_internal;
	import mx.rpc.AbstractOperation;
	import mx.rpc.AsyncToken;
	import mx.rpc.events.FaultEvent;
	import mx.rpc.events.ResultEvent;
	import mx.rpc.remoting.RemoteObject;

	use namespace mx_internal;
	public class AsyncTokenExec extends AsyncToken {
		public var operation:AbstractOperation; 
		protected var ro:RemoteObject;
		public function AsyncTokenExec(ro:RemoteObject=null) {
			this.ro = ro;
		}
		public function execute(... args:Array):void {
			throw new Error("Need to implement 'public function execute(... args:Array):void' method");
		}
	    protected function applyResultEvent(event:ResultEvent):void {
	    	this.operation.dispatchEvent(event);
	    	super.mx_internal::applyResult(event)
	    }
				    	
	    protected function applyFaultEvent(event:FaultEvent):void {
	    	this.operation.dispatchEvent(event);
	    	super.mx_internal::applyFault(event)
	    }
	}
}